package com.nulldev.util.java;

import com.nulldev.util.FinalBypass;

public class var<T> {

	private T obj;

	public var(final T obj){
		this.obj = obj;
	}

	public T object() {
		return this.obj;
	}

	public void update(final T obj) {
		this.obj = obj;
	}

	public FinalBypass<T> toBypass() {
		return new FinalBypass<T>(this.obj);
	}

	@Override
	public String toString() {
		if (this.obj.getClass().isAssignableFrom(String.class)) {
			return (String) this.obj;
		}else {
			return String.valueOf(this.obj);
		}
	}
	
	public void println() {
		JVMUtil.async_println(this.obj);
	}
}
